<template>
  <el-table :data="tableData" style="width: 100%" height="100%">
    <el-table-column prop="id" label="ID" width="80" />
    <el-table-column
      prop="cmd"
      label="指令内容"
      width="200"
      show-overflow-tooltip
    />
    <el-table-column prop="cmdType" label="命今类型" show-overflow-tooltip />
    <el-table-column prop="createTime" label="时间" width="150">
      <template slot-scope="scope">
        {{ scope.row.createTime.substr(10) }}
      </template>
    </el-table-column>
    <el-table-column label="完成状态" width="100">
      <template slot-scope="scope">
        <el-tag :type="scope.row.state | tagType">{{
          scope.row.state | status
        }}</el-tag>
      </template>
    </el-table-column>
    <el-table-column label="操作" width="200">
      <template slot-scope="scope">
        <el-button
          icon="el-icon-close"
          type="text"
          v-if="!scope.row.state"
          v-hasPermi="['assembly:device:edit']"
          @click="handlerCmd('fallbackAction', scope.row)"
          >取消</el-button
        >
        <el-button
          icon="el-icon-check"
          type="text"
          v-if="!scope.row.state"
          v-hasPermi="['assembly:device:edit']"
          @click="handlerCmd('executionCompleted', scope.row)"
          >完成</el-button
        >
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
import mixin from "../mixin/index";
export default {
  mixins: [mixin],
  props: {
    tableData: {
      type: Array,
      default: () => {
        return [];
      },
    },
  },
};
</script>

<style>
</style>